<%@ page language="java" contentType="text/html; charset=UTF-8" import="org.windblog.core.entity.*,java.util.*,org.windblog.core.*"  pageEncoding="UTF-8"%>
<%@ page import="com.google.appengine.api.blobstore.BlobstoreServiceFactory" %> 
<%@ page import="com.google.appengine.api.blobstore.BlobstoreService" %>

		<jsp:include page="header.jsp"></jsp:include>
		<jsp:include page="sidebar.jsp"></jsp:include>
		<script type="text/javascript">
			$(function(){
				// Accordion
				$("#accordion").accordion("activate",1);
				$("#media_library").prepend(">");
				$("#update").button();
			});
		</script>
<%
	String action = request.getParameter("action");
	String filekey   = request.getParameter("filekey");
	File file = FileService.getFile(filekey);
%>
		<div id="content">
			<h2>Edit Media</h2>
			<hr/>
			<div id="editMediaForm" style="float:left;padding:20px;width:100%"> 
				<form action="setfile" method="post">
					<input type="hidden" name="filekey" value="<%=file.getStrKey() %>"/>
					<div id="fileInfo" style="width:200px">
					<p>
						<%=file.getFilename() %><br/>
						<%=file.getContentType() %><br/>
						<%=file.getDate().toLocaleString()  %>
					</p>
					</div>
					Title<br/>
					<input type="text" name="title" value="<%=file.getTitle() %>"/><br/>
					Description<br/>
					<textarea name="description" rows="5" cols="30"><%=file.getDescription() %></textarea><br/>
					<input id="update" type="submit" value="Update" /> 
				</form>
			</div> 
		</div>
		
		<jsp:include page="footer.jsp"></jsp:include>
